# !/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName : zsj.py
# @Time     : 2024/4/10 21:48
# @Author   : Robot-Zsj
"""
description:

input
0 5 8 9 9 10
5 0 9 9 9 8
output
8 7
"""
black = list(map(int, input().split()))
white = list(map(int, input().split()))


def getResult():
    board = [[0] * 19 for _ in range(19)]

    for i in range(0, len(black), 2):
        x = black[i]
        y = black[i + 1]
        board[x][y] = 1

    for i in range(0, len(white), 2):
        x = white[i]
        y = white[i + 1]
        board[x][y] = 2

    black_liberty_count = 0
    white_liberty_count = 0

    offsets = ((-1, 0), (0, -1), (1, 0), (0, 1))

    for i in range(19):
        for j in range(19):
            if board[i][j] == 0:
                isBlackLiberty = False
                isWhiteLiberty = False

                for offsetX, offsetY in offsets:
                    newI = i + offsetX
                    newJ = j + offsetY

                    if newI < 0 or newI >= 19 or newJ < 0 or newJ >= 19:
                        continue

                    isBlackLiberty = isBlackLiberty or (board[newI][newJ] == 1)
                    isWhiteLiberty = isWhiteLiberty or (board[newI][newJ] == 2)

                if isBlackLiberty:
                    black_liberty_count += 1

                if isWhiteLiberty:
                    white_liberty_count += 1

    return f"{black_liberty_count} {white_liberty_count}"


print(getResult())